/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.data.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author thiago
 */
@Entity
@Table(name = "admin")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Admin.findAll", query = "SELECT a FROM Admin a"),
    @NamedQuery(name = "Admin.findByCodigoadmin", query = "SELECT a FROM Admin a WHERE a.codigoadmin = :codigoadmin"),
    @NamedQuery(name = "Admin.findByLogin", query = "SELECT a FROM Admin a WHERE a.login = :login"),
    @NamedQuery(name = "Admin.findBySenha", query = "SELECT a FROM Admin a WHERE a.senha = :senha")})
public class Admin implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codigoadmin")
    private Integer codigoadmin;
    @Column(name = "login")
    private String login;
    @Column(name = "senha")
    private String senha;

    public Admin() {
    }

    public Admin(Integer codigoadmin) {
        this.codigoadmin = codigoadmin;
    }

    public Integer getCodigoadmin() {
        return codigoadmin;
    }

    public void setCodigoadmin(Integer codigoadmin) {
        this.codigoadmin = codigoadmin;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoadmin != null ? codigoadmin.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Admin)) {
            return false;
        }
        Admin other = (Admin) object;
        if ((this.codigoadmin == null && other.codigoadmin != null) || (this.codigoadmin != null && !this.codigoadmin.equals(other.codigoadmin))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.data.model.Admin[ codigoadmin=" + codigoadmin + " ]";
    }
    
}
